<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>后台管理系统</title>
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/all.min.css" rel="stylesheet">
    <link href="css/style.css" rel="stylesheet">
    <style>
        .sidebar {
            width: 250px;
            height: 100vh;
            position: fixed;
            left: 0;
            top: 0;
            background: #343a40;
            padding: 1rem;
        }
        .content {
            margin-left: 250px;
            height: 100vh;
            display: flex;
            flex-direction: column;
        }
        .tab-bar {
            background: #f8f9fa;
            padding: 0.5rem 1rem;
            border-bottom: 1px solid #dee2e6;
        }
        .tab-content {
            flex: 1;
            position: relative;
        }
        .tab-content iframe {
            width: 100%;
            height: 100%;
            border: none;
            position: absolute;
        }
        .nav-link {
            color: rgba(255,255,255,.75);
            padding: 0.5rem 1rem;
            margin: 0.25rem 0;
            border-radius: 0.25rem;
        }
        .nav-link:hover {
            color: #fff;
            background: rgba(255,255,255,.1);
        }
        .nav-link.active {
            color: #fff;
            background: #0d6efd;
        }
        .tab-item {
            display: inline-flex;
            align-items: center;
            background: #fff;
            border: 1px solid #dee2e6;
            border-radius: 0.25rem;
            padding: 0.25rem 0.75rem;
            margin-right: 0.5rem;
            cursor: pointer;
        }
        .tab-item.active {
            background: #0d6efd;
            color: #fff;
            border-color: #0d6efd;
        }
        .tab-close {
            margin-left: 0.5rem;
            width: 16px;
            height: 16px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
        }
        .tab-close:hover {
            background: rgba(0,0,0,.1);
        }
    </style>
</head>
<body>
    <div id="app">
        <!-- 侧边栏 -->
        <div class="sidebar">
            <h5 class="text-white mb-4">后台管理系统</h5>
            <div class="nav flex-column">
                <a v-for="menu in menus" 
                   :key="menu.path"
                   class="nav-link"
                   :class="{ active: activeTab === menu.path }"
                   href="#"
                   @click.prevent="openTab(menu)">
                    <i :class="menu.icon" class="me-2"></i>
                    {{ menu.name }}
                </a>
            </div>
        </div>

        <!-- 主内容区 -->
        <div class="content">
            <!-- 标签栏 -->
            <div class="tab-bar">
                <div v-for="tab in tabs" 
                     :key="tab.path"
                     class="tab-item"
                     :class="{ active: activeTab === tab.path }"
                     @click="switchTab(tab)">
                    {{ tab.name }}
                    <span class="tab-close" @click.stop="closeTab(tab)">×</span>
                </div>
            </div>

            <!-- iframe容器 -->
            <div class="tab-content">
                <iframe v-for="tab in tabs"
                        :key="tab.path"
                        :src="tab.path"
                        :style="{ display: activeTab === tab.path ? 'block' : 'none' }">
                </iframe>
            </div>
        </div>
    </div>

    <script src="js/lib/vue.min.js"></script>
    <script src="js/index.js"></script>
</body>
</html> 